import http from "@/utils/request";
import axios from "axios";
import {getSemester} from "@/utils";




export function post(url = '', data) {
  if (!url.startsWith("/")) {
    url = '/'.concat(url)
  }
  if(data == null){
    data={}
  }
  if(!data.classYear && !data.semester && typeof data == 'object'){
    data.semester= data.classYear = getSemester()
  }
  return  http({
      url,
      method: 'post',
      data: data

    })
}
export function get(url = '', data) {
  if (!url.startsWith("/")) {
    url = '/'.concat(url)
  }
  if(data == null){
    data={}
  }
  return http({
      url,
      method: 'get',
      params: data
    })

}
